Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add probability field calc and plots #127

Merged
merged 8 commits into from
Dec 20, 2023
Merged

Conversation

SorooshMani-NOAA
Copy link
Collaborator

No description provided.

@SorooshMani-NOAA SorooshMani-NOAA self-assigned this Dec 18, 2023
@SorooshMani-NOAA SorooshMani-NOAA linked an issue Dec 18, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2023

Codecov Report

Attention: 89 lines in your changes are missing coverage. Please review.

Comparison is base (1fbaf14) 21.29% compared to head (830ede3) 20.80%.
Report is 1 commits behind head on main.

Files Patch % Lines
...rturbation/uncertainty_quantification/surrogate.py 0.00% 55 Missing ⚠️
ensembleperturbation/plotting/surrogate.py 0.00% 33 Missing ⚠️
ensembleperturbation/parsing/schism.py 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   21.29%   20.80%   -0.49%     
==========================================
  Files          28       28              
  Lines        3762     3850      +88     
==========================================
  Hits          801      801              
- Misses       2961     3049      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SorooshMani-NOAA
Copy link
Collaborator Author

This is an example of its use. I got better result on a different dataset, but I don't have it now!

image

Comment on lines 676 to 679
if minimum_allowable_value is not None:
too_small = (training_set + training_set['depth']).values < minimum_allowable_value
training_set.values[too_small] = numpy.nan
training_set = numpy.fmax(training_set, -training_set['depth'])
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WPringle could the difference in the model vs surrogate be how/when we adjust?
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. What was the min_depth set and what are the depths in the SCHISM model on the overland points that get wet from NWM?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the mindepth is 0.01, I need to check the depths on the overland... I'll get back to you on that. In the meantime, can you please also take a look at the newly added code as a whole and see if you spot any obvious/conceptual mistakes or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WPringle minimum allowable depth is set to 0.8 * h0 which is 0.8 * 0.01. The depths that are set as being too small are:

too_small = (maxelev+ depths).values < min_depth

These nodes are set to nan in the latest version of the code; in an earlier version, these values would then be set to be equal to -depth which resulted in the earlier plots above
Looking at the max and min of the depths and maxelev of the too_small region show:

depths[too_small.any(axis=0)].min(), depths[too_small.any(axis=0)].max(), depths[too_small.any(axis=0)].mean()
# (-44.28715, -0.01106, -5.5330863)

maxelev[too_small].min(), maxelev[too_small].max(), maxelev[too_small].mean()
# (0.010003523, 44.07152, 5.2620897)

Copy link
Contributor

@WPringle WPringle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can see the computation of the probabilities of exceedance makes sense.

Only request change for figure title from "comparison of probability fields at level: {lvl}"
to "Probability of water level exceeding {lvl}-m" or something similar

@SorooshMani-NOAA
Copy link
Collaborator Author

@WPringle swapping the order of set small elev to null and set null to depth for model calculation, (i.e.

if minimum_allowable_value is not None:
too_small = (training_set + training_set['depth']).values < minimum_allowable_value
training_set.values[too_small] = numpy.nan

and
training_set = numpy.fmax(training_set, -training_set['depth'])

) resulted in these plots:
image

I think it might make more sense to keep the swapped version. What do you think?

@SorooshMani-NOAA
Copy link
Collaborator Author

These are the first couple of probability fields for the 30 member Florence run with OFCL track (past forecast, no NWM)

image

@SorooshMani-NOAA SorooshMani-NOAA merged commit 33bcce5 into main Dec 20, 2023
8 checks passed
@SorooshMani-NOAA SorooshMani-NOAA deleted the feature/prob_fields branch December 20, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Probability field plots for ensemble
3 participants